<?php
namespace app\common\model;

use think\Model;

class SmsLog extends Base
{
    protected $table = 'sms_logs';


    public function getTypeLabelAttr($value, $data)
    {
        switch ($data['type']) {
            case 'register':
                $result = '注册';
                break;
			case 'login':
                $result = '登陆';
                break;
            default:
                $result = '';

        }

        return $result;
    }

    public function getCreateTimeLabelAttr($value, $data)
    {
        if (empty($data['create_time'])) {
            return '暂无';
        }

        return date('Y-m-d H:i:s', $data['create_time']);
    }

    public function getFailTimeLabelAttr($value, $data)
    {
        if (empty($data['fail_time'])) {
            return '暂无';
        }

        return date('Y-m-d H:i:s', $data['fail_time']);
    }


}